package com.lighting.lightingservice.mapper;

import com.lighting.lightingservice.dto.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface PageMapper {

    @Select("""
            select sliderImgUrl1, sliderTitleUp1, sliderTitleDown1,
            sliderImgUrl2, sliderTitleUp2, sliderTitleDown2,
            sliderImgUrl3, sliderTitleUp3, sliderTitleDown3,
            mainVideo, mainVideoImg,
            midTitleUp, midTitleDown,
            blockTitle1, blockTitle2, blockTitle3, blockTitle4,
            blockImg1, blockImg2, blockImg3, blockImg4,
            blockVideo1, blockVideo2, blockVideo3, blockVideo4
            from page
            """)
    List<Page> findAll();

    @Update("""
            update page set sliderTitleUp1 = #{sliderTitleUp1}
            """)
    void updateSliderTitleUp1(String sliderTitleUp1);

    @Update("""
            update page set sliderTitleDown1 = #{sliderTitleDown1}
            """)
    void updateSliderTitleDown1(String sliderTitleDown1);

    @Update("""
            update page set sliderTitleUp2 = #{sliderTitleUp2}
            """)
    void updateSliderTitleUp2(String sliderTitleUp2);

    @Update("""
            update page set sliderTitleDown2 = #{sliderTitleDown2}
            """)
    void updateSliderTitleDown2(String sliderTitleDown2);

    @Update("""
            update page set sliderTitleUp3 = #{sliderTitleUp3}
            """)
    void updateSliderTitleUp3(String sliderTitleUp3);

    @Update("""
            update page set sliderTitleDown3 = #{sliderTitleDown3}
            """)
    void updateSliderTitleDown3(String sliderTitleDown3);



    @Update("""
            update page set midTitleUp = #{midTitleUp}
            """)
    void updateMidTitleUp(String midTitleUp);

    @Update("""
            update page set midTitleDown = #{midTitleDown}
            """)
    void updateMidTitleDown(String midTitleDown);



    @Update("""
            update page set blockTitle1 = #{blockTitle1}
            """)
    void updateBlockTitle1(String blockTitle1);

    @Update("""
            update page set blockTitle2 = #{blockTitle2}
            """)
    void updateBlockTitle2(String blockTitle2);

    @Update("""
            update page set blockTitle3 = #{blockTitle3}
            """)
    void updateBlockTitle3(String blockTitle3);

    @Update("""
            update page set blockTitle4 = #{blockTitle4}
            """)
    void updateBlockTitle4(String blockTitle4);
}
